package fr.afcepf.atod18.commande.web;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;

import fr.afcepf.atod18.commande.entity.EtatCommande;
import fr.afcepf.atod18.commande.service.IServiceEtatCommande;

@ManagedBean
@SessionScoped
public class CreerEtatCommandeMB {
	
	@ManagedProperty(value="#{serviceEtatCommande}")
	private IServiceEtatCommande serviceEtatCommande;
	
	private int id;
	private String libelle;
	
	public String doAffichageEtatCommande() {
		
		return null;
	}
	public String doCreerEtatCommande() {
		EtatCommande etatCommande = new EtatCommande(libelle);
		serviceEtatCommande.ajouter(etatCommande);
		return null;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getLibelle() {
		return libelle;
	}
	public void setLibelle(String libelle) {
		this.libelle = libelle;
	}
    /**
     * @return the serviceEtatCommande
     */
    public IServiceEtatCommande getServiceEtatCommande() {
        return serviceEtatCommande;
    }
    /**
     * @param paramServiceEtatCommande the serviceEtatCommande to set
     */
    public void setServiceEtatCommande(IServiceEtatCommande paramServiceEtatCommande) {
        serviceEtatCommande = paramServiceEtatCommande;
    }
	
}
